INCLUDE = -I/usr/include/
LIBDIR  = -L/usr/X11R6/lib 

COMPILERFLAGS = -Wall
CC = gcc
CFLAGS = -g $(COMPILERFLAGS) $(INCLUDE)
LIBRARIES = -lX11  -lglut -lGL -lGLU -lm 

# for all, set the targets to be every lesson1.c-lesson13.c 
# file, removing the .c extension.  That is, at this point,
# it would produce lesson1, lesson2, lesson3,...,lesson13 targets.
#
all: $(basename $(wildcard lesson0[1-9].c lesson1[0-9].c lesson2[0-9].c lesson3[0-9].c))


# to produce, say, lesson1:
#
# 1. compile the thing.  uses the variables defined above.
# 
lesson% : lesson%.o
	$(CC) $(CFLAGS) -o $@ $(LIBDIR) $< $(LIBRARIES)  

# to clean up:
# delete all of the lessonX files.
clean:
	rm $(wildcard lesson0[1-9] lesson1[0-9] lesson2[0-9] lesson3[0-9])


